package homework4;

import lombok.*;

import java.util.Objects;

/**
 * @classname:Student
 * @description:
 * @author: Mr.Z
 * @date: 2020/12/14 17:40
 * @version: 0.1
 * @since:1.8
 */
@Setter
@Getter
@AllArgsConstructor
@NoArgsConstructor
@ToString

public class Student {
    private Integer id;
    private Integer score;
    private String name;

    public Student(Integer id, Integer score) {
        this.id = id;
        this.score = score;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Student student = (Student) o;
        return Objects.equals(id, student.id);
    }

    @Override
    public int hashCode() {

        return Objects.hash(id);
    }
}
